<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a = '123';
    var b = "222";
    var c = ``; //反引号，在ESC下一个键
    var divStart = "<div>";
    var divEnd = "</div>"
    // var divContent = "这是内容";
    var div = "<div>这是内容</div>"
    // 通过prompt自定义内容
    var divContent = prompt("请输入内容");
    document.write(divStart + divContent + divEnd);
    // 请通过write输出一个input，如下，到页面上
    // <input type="text" name="name" placeholder="请输入账号">
    // var input = '<input type="text" name="name" placeholder="请输入账号">';
    // var input = "<input type=\"text\" name=\"name\" placeholder=\"请输入账号\">"
    // var type = "text";
    // var input = "<input type='" + type +
    // document.write(input);
    // table
    var name = "张三";
    document.write("<table>" +
        "<thead>" +
        "<th>姓名</th>" +
        "</thead>" +
        "<tbody>" +
        "<td>" + name + "</td>" +
        "</tbody>" +
        "</table>");
    var d = `
        <table>
            <thead>
                 <th>姓名</th>
            </thead>
            <tbody>
                <td>${name}</td>
</tbody>
        </table>
    `;
    document.write(d);

    console.log(d.length);
    console.log("你好，  这是字符串abc".length);

    console.log(true.toString());
    // console.log(undefined.toString());//null和undefined没有此方法

    console.log(123 + "" + 1); // 1231
    console.log(123 + 1 + ""); //124
    console.log(String(123));
</script>
</body>
</html>